<template>
  <div>
    <div class="checkbox-groups">
      <div class="checkbox-content">
        <div class="title mt-16" ref="title">Flight Management Computer(CMCICFM) Event</div>
        <div class="groups">
          <a-radio-group :value="notificationService.cmc" @change="changeCmc">
            <a-radio v-for="item in cmcEventList" :key="item.id" :value="item.name" :style="radioStyle">
              {{ item.name }}
            </a-radio>
          </a-radio-group>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { mapState, mapMutations } from 'vuex';
export default {
  props: {
    cmcEventList: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      cmcValue: null,
      radioStyle: {
        display: 'block',
        height: '30px',
        lineHeight: '30px'
      }
    };
  },
  computed: {
    ...mapState('emailNotification', ['notificationService'])
  },
  methods: {
    getTitle(){
      return this.$refs.title.innerHTML
    },
    ...mapMutations('emailNotification', ['setState']),
    changeCmc(e) {
      this.setState({ key: 'notificationService', payload: { ...this.notificationService, cmc: e.target.value }});
    }
  }
};
</script>
<style lang="less">
            .checkbox-groups {
            margin-bottom: 30px;
            .groups{
            display: flex;
            flex-direction: column;
            border: 1px solid #DDDDDD;
            padding: 8px;
            box-sizing: border-box;
            margin-top: 8px;
            /deep/.ant-checkbox-wrapper {
                margin-left: 0;
            }
    }
        }
</style>
